//使用原生写法解决初始化忽大忽小问题
(function() {
    var html = document.documentElement;
    var body = document.body;
    window.addEventListener("resize", calc, false);
    document.addEventListener("DOMContentLoaded", calc, false);
    calc();
    function calc() {
      var width =
        html.clientWidth ||
        body.clientWidth ||
        window.screen.width ||
        window.innerWidth;
      html.style.fontSize = width / 7.5 + "px";
      html.dataset.dpr = window.devicePixelRatio;
    }
  })();